import type { AxiosPromise } from "axios";
import type { LoginForm } from "./types";
import request from "@/utils/request";
import type { Result } from "@/model";

/**
 * 用户登录
 * @param data 登录信息
 * @returns Token
 */
export function login(data: LoginForm): AxiosPromise<Result<string>> {
    return request({
        url: "/login",
        method: "post",
        data,
    });
}